const validate = (formRef: any) => {
  const hasError: boolean[] = [];
  const result = formRef.getValidationComponents();
  for (let i = 0; i < result.length; i++) {
    const item = result[i];
    hasError.push(item.validate());
  }
  return hasError.includes(false) ? false : true;
};

export default validate;
